import Vue from "vue";
import VueRouter from "vue-router";
import Login from "../views/Login.vue";
import Home from "../views/Home.vue"; 
import welcome from "../components/welcome.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/login",
    // omponent: HomeView
  },
  {
    path: "/login",
    name: "Login",
    component: Login,
  },
  {
    path: "/home",
    component: Home,
    children: [
      {
        path: "/",
        name: "welcome",
        component: welcome,
      },
      {
        path: "/administrator",
        name: "administrator",
        component:()=>import("@/components/administrator.vue") ,
      },
      {
        path: "/administratorrole",
        name: "administratorrole",
        component:()=>import("@/components/administratorrole.vue") ,
      },
      {
        path: "/fee",
        name: "fee",
        component:()=>import("@/components/fee.vue") ,
      },
      {
        path: "/userinfo",
        name: "userinfo",
        component:()=>import("@/components/userinfo.vue") ,
      },
      {
        path: "/repairs",
        name: "repairs",
        component:()=>import("@/components/repairs.vue") ,
      },
      {
        path: "/questions",
        name: "questions",
        component:()=>import("@/components/questions.vue") ,
      },
      {
        path: "/staffs",
        name: "staffs",
        component:()=>import("@/components/staffs.vue") ,
      },
      {
        path: "/news",
        name: "news",
        component:()=>import("@/components/news.vue") ,
      },
      {
        path: "/stores",
        name: "stores",
        component:()=>import("@/components/stores.vue") ,
      },
      {
        path: "/building",
        name: "building",
        component:()=>import("@/components/building.vue") ,
      },
      {
        path: "/house",
        name: "house",
        component:()=>import("@/components/house.vue") ,
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
